#pragma once
#include "Player.h"
#include "House.h"

namespace catan
{
	class PlayerPack : public BoardItem
	{
	public:
		PlayerPack(void);
		~PlayerPack(void);
		void SetPlayerColor(PlayerColor::Enum color);

		template <class _Ty>
		void SetColor(_Ty& ty, PlayerColor::Enum color);

		int FindLongestRoadNum();
	protected:

		
	public:
		Roads mRoads;
		Houses mHouses;
		Settlements mSettlements;

	public:
		template<class Serializer>
		void serialize(Serializer & s, const unsigned int version)
		{
			s & mRoads & mHouses & mSettlements;
		}
	};

	template <class _Ty>
	void PlayerPack::SetColor( _Ty& ty, PlayerColor::Enum color)
	{
		for (typename _Ty::iterator it(ty.begin());
			it != ty.end(); ++it)
		{
			(*it)->SetColor(color);
		}
	}
}	
